<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>目录的自动高亮</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    a {
      text-decoration: none;
      color: #000;
    }
    .container {
      display: flex;
      width: 100%;
    }
    .container .left {
      width: 200px;
      position: fixed;
      top: 0;
      left: 0;
    }
    .container .right {
      padding-left: 200px;
    }
    a.highlight {
      color: #f00;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="left">
      <ul>
        <li><a href="#title-1">概述</a></li>
        <li>
          <a href="#title-2">简单请求</a>
          <ul>
            <li><a href="#title-3">简单请求的判定</a></li>
            <li><a href="#title-4">简单请求的交互规范</a></li>
          </ul>
        </li>
        <li>
          <a href="#title-5">需要预检的请求</a>
        </li>
        <li>
          <a href="#title-6">附带身份凭证的请求</a>
        </li>
        <li>
          <a href="#title-7">一个额外的补充</a>
        </li>
      </ul>
    </div>
    <div class="right">
      <h1 id="title-1">概述</h1>
      <div style="height: 800px"></div>
      <h1 id="title-2">简单请求</h1>
      <div style="height: 300px"></div>
      <h2 id="title-3">简单请求的判定</h2>
      <div style="height: 500px"></div>
      <h2 id="title-4">简单请求的交互规范</h2>
      <div style="height: 500px"></div>
      <h1 id="title-5">需要预检的请求</h1>
      <div style="height: 500px"></div>
      <h1 id="title-6">附带身份凭证的请求</h1>
      <div style="height: 500px"></div>
      <h1 id="title-7">一个额外的补充</h1>
      <div style="height: 500px"></div>
    </div>
  </div>
  <script src="./index.js"></script>
</body>
</html>